using System;
using Kollektiv.DB;

namespace Kollektiv.DataModel
{
	public class SessionRepository:DataRepository<Session>
	{
		public SessionRepository (DataManager manager):base(manager)
		{
		}
		
		public Session Create (User owner)
		{
			Session session = new Session (){
				Owner=owner,
				CreationTime=DateTime.UtcNow
			};
			session.SetActivity ();
			
			this.SaveOrUpdate (session);
			
			return session;
		}
	}
}

